<?php
declare (strict_types=1);

namespace app\command;

use app\model\order\OrderItemModel;
use think\console\Command;
use think\console\Input;
use think\console\Output;

/**
 * 指令-正向商城-每天晚上1点开始结算前一天的商城消费情况
 * Class CheckGameSettle
 * @package app\command
 */
class CheckOrderSettle extends Command
{
    protected function configure()
    {
        $this->setName('check_order_settle_timeout')->setDescription('the check_order_settle_timeout command');
    }

    /**
     * @param Input $input
     * @param Output $output
     * @return int|null|void
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     */
    protected function execute(Input $input, Output $output)
    {
        //正向商城结算
//        $start_time = strtotime(date("Y-m-d")) - (3600 * 24);
//        $end_time = strtotime(date("Y-m-d") . " 23:59:59") - (3600 * 24);
//        $start_time = strtotime(date("Y-m-d"));
//        $end_time = strtotime(date("Y-m-d") . " 23:59:59");
        OrderItemModel::getSettleSale();
        echo "success";
    }
}
